#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
const int N = 60;
int a[N][N];
int main()
{
	int n;
	cin >> n;
	a[1][(1 + n) / 2] = 1;
	int x = 1, y = (1 + n) / 2;
	for (int i = 2; i <= n * n; i++)
	{
		if (x == 1 && y != n)
		{
			a[n][y + 1] = i;
			x = n;
			y = y + 1;
		}
		else if (x != 1 && y == n)
		{
			a[x - 1][1] = i;
			x = x - 1;
			y = 1;
		}
		else if (x == 1 && y == n)
		{
			a[x + 1][y] = i;
			x = x + 1;
		}
		else if (x != 1 && y != n)
		{
			if (a[x - 1][y + 1] == 0)
			{
				a[x - 1][y + 1] = i;
				x = x - 1;
				y = y + 1;
			}
			else
			{
				a[x + 1][y] = i;
				x = x + 1;
			}
		}
	}
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	return 0;
}
